layui.use(['layer'],function () {
    var $ = layui.jquery;
    var layer=layui.layer;
    $(function () {
        var userid=$('#userid').text();
        window.userid=userid;
    });
    $("#loginOut").click(function (e) {
        window.location.href="/Ticket/home/loginOut";
    })
    $('#return').click(function () {
        $.ajax({
            type: 'post',
            url:'/Ticket/userIndex/onload',
            dataType: 'json',
            success:function (res) {
                if (res.code==0)
                {
                    window.location.href = "/Ticket/home/main";
                }
                else {
                    layer.msg("返回失败");
                }
            }
        })
    });
    $('#username').click(function () {
            var value=$('#username').text();
            if (value=='请登录')
            {
                window.location.href="/Ticket/home/loginOut";
            }
            else
            {
                layer.msg("你以登录");
            }
    });
    $('#myInfo').click(function () {
        // $('my111').click();
        var ifr=document.getElementById('ifr');
        var url='../templates/myInfo.html';
        ifr.src=url;
    })
})